<?php

namespace app\common\business;

use \app\common\model\mysql\Admin as adminMd;

class Admin
{

    public function __construct()
    {
        $this->model = new adminMd();
    }

    public function getRoleByUserId($id){
        //查询用户的角色
        return $this->model->getRoleByUserId([['id','=',$id]],'id,username,role_id','id,role_name,desc,role_auth_ids')->toArray();
    }

    public function getAdminList()
    {
        //查询所有用户列表
        return $this->model->getRoleByUserId([],'id,username,email,nickname,last_login_time,status,role_id','id,role_name')->toArray();

    }
}